package Game;

import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;

import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;

public class FirstLevel extends JFrame {

	private int widthWindow = 800;
	private int heightWindow = 600;
	private int widthScreen;
	private int heightScreen;
	private static JLabel labelLvl1;
	private ImageIcon Intro;
	private Icon icono;

	public void StartGame() {
		Window();
		// Background of the Level 1
		Intro = new ImageIcon("Resources/LevelOne/lvl1.gif");
		icono = new ImageIcon(Intro.getImage().getScaledInstance(getWidth(),
				getHeight(), Image.SCALE_DEFAULT));
		labelLvl1 = new JLabel(Intro);
		labelLvl1.setIcon(icono);
		this.add(labelLvl1);
		setVisible(true);
	}

	public void paint(Graphics g) {
		resizeJlabel();
	}

	private void resizeJlabel() {
		Intro = new ImageIcon("Resources/LevelOne/lvl1.gif");
		icono = new ImageIcon(Intro.getImage().getScaledInstance(getWidth(),
				getHeight(), Image.SCALE_DEFAULT));
		labelLvl1.setIcon(icono);

	}

	private void Window() {
		widthScreen = Toolkit.getDefaultToolkit().getScreenSize().width;
		heightScreen = Toolkit.getDefaultToolkit().getScreenSize().height;
		setSize(widthWindow, heightWindow);
		setLocation(widthScreen / 2 - widthWindow / 2, heightScreen / 2
				- heightWindow / 2);
		setTitle("Project - LvL 1");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
}
